<?php
if (!is_numeric($_GET['id'])) {
    echo 'Invalid ID';
    exit;
}
require_once(dirname(__FILE__).'/../wp-config.php');
$link = get_post_meta($_GET['id'], 'link-download', true);
if ($link) {
    header('location: '.$link);
} else {
    echo 'Invalid ID';
}
exit;
?>